//	ID : pallab81
// 	PROG : 10034
// 	LANG : C++
// 	2011-09-10-17.03.12 Saturday
//
// 	"I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <iomanip>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define VI vector< int >
#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define fo(i,st,ed) for(int i = st ; i < ed ; ++i )
#define foE(i,st,ed) for(int i = st ; i <= ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )
#define DP pair<double, pair<int, int> >
inline void wait( double seconds ){
    double endtime = clock()+( seconds* CLOCKS_PER_SEC );
    while( clock() < endtime ){
        ;
    }
}

const int inf = (int)1e6;
int root[ inf+10 ];
int rank[ inf+10 ];
inline void _Set(){
    fo(i,0,inf){
        root[i]=i;
        rank[i]=0;
    }
}
inline int _Find(int x){
    if( x!= root[x] ){
        root[x] = _Find(root[x]);
    }
return root[x];
}
inline void _Union(int x, int y){
    int rx = _Find(x);
    int ry = _Find(y);

    if( rank[rx] > rank[ry] ){
        root[ry] = rx;
    }
    else{
        root[rx] = ry;
    }
    if( rank[rx]==rank[ry] ){
        rank[ry]+=1;
    }
}

inline double dist(double x1, double y1, double x2, double y2){
    double X = x1-x2;
    double Y = y1-y2;
    return sqrt ( X*X + Y*Y ) ;
}
string ss;
int N;
set< DP, less< DP > > pq;
inline void Read(){
    pq.clear();
    CI(N);
    vector<double> x(N),y(N);
    fo(i,0,N){
        cin>>x[i]>>y[i];
    }
    fo(i,0,N){
        fo(j,i+1,N){
            double d = dist(x[i],y[i],x[j],y[j]) ;
            pq.insert( mk(d, mk(i,j) ) );
        }
    }
}
inline void Proc(){
    _Set();
    double cost=0;
    while( pq.empty()==false ){
        DP temp = (*pq.begin());
        pq.erase( pq.begin() );

        double c = temp.f;
        int sx= temp.s.f;
        int sy= temp.s.s;
        if( _Find(sx)!=_Find(sy) ){
            _Union(sx,sy);
            cost+=c;
        }
    }
    printf("%s%.2lf\n",ss.c_str(),cost);
    ss="\n";
}
int main(){
//    #ifndef ONLINE_JUDGE
//        freopen("in.txt","rt",stdin);
//    #endif
    ss="";
    int cases=1;
    for( CI(cases) ; cases ; --cases ){
        Read();
        Proc();
    }

return 0;
}
